package com.iqiyi.pps.epg.core.model.statistic;

import com.iqiyi.pps.epg.api.model.web.statistic.TStatisticSty2Data;
import com.iqiyi.pps.epg.core.utils.DateTimeUtil;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by zhang on 2016/4/21.
 */
@Entity
@Table(name="st_sty2_data")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StatisticSty2Data {

    private long id;
    private String channelId;
    private String channelName;
    private String channelCode;
    private String programId;
    private String programName;
    private String categoryName;
    private String albumName;
    private int programTime;
    private int headerCompleteNumbers;
    private int headerIncompleteNumbers;
    private int headerFaultNumbers;
    private int lastCompleteNumbers;
    private int lastIncompleteNumbers;
    private int lastFaultNumbers;
    private int adCompleteNumbers;
    private int adIncompleteNumbers;
    private int adFaultNumbers;
    private String user;
    private Timestamp statisticTime = new Timestamp(System.currentTimeMillis());


    public TStatisticSty2Data convertThriftModel() {
        TStatisticSty2Data tStatisticSty2Data = new TStatisticSty2Data();
        tStatisticSty2Data.setId(this.getId());
        tStatisticSty2Data.setChannelId(this.getChannelId());
        tStatisticSty2Data.setChannelName(this.getChannelName());
        tStatisticSty2Data.setChannelCode(this.getChannelCode());
        tStatisticSty2Data.setProgramId(this.getProgramId());
        tStatisticSty2Data.setProgramName(this.getProgramName());
        tStatisticSty2Data.setCategoryName(this.getCategoryName());
        tStatisticSty2Data.setAlbumName(this.getAlbumName());
        tStatisticSty2Data.setProgramTime(this.getProgramTime());
        tStatisticSty2Data.setUser(this.getUser());
        tStatisticSty2Data.setStatisticTime(DateTimeUtil.transLongFormat(this.getStatisticTime().getTime()));
        tStatisticSty2Data.setHeaderCompleteNumbers(this.getHeaderCompleteNumbers() + "");
        tStatisticSty2Data.setHeaderIncompleteNumbers(this.getHeaderIncompleteNumbers() + "");
        tStatisticSty2Data.setHeaderFaultNumbers(this.getHeaderFaultNumbers() + "");
        tStatisticSty2Data.setLastCompleteNumbers(this.getLastCompleteNumbers() + "");
        tStatisticSty2Data.setLastIncompleteNumbers(this.getLastIncompleteNumbers() +"");
        tStatisticSty2Data.setLastFaultNumbers(this.getLastFaultNumbers() +"");
        tStatisticSty2Data.setAdCompleteNumbers(this.getAdCompleteNumbers() + "");
        tStatisticSty2Data.setAdIncompleteNumbers(this.getAdIncompleteNumbers() + "");
        tStatisticSty2Data.setAdFaultNumbers(this.getAdFaultNumbers() + "");
        return tStatisticSty2Data;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name="channel_id")
    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    @Column(name="channel_name")
    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    @Column(name="channel_code")
    public String getChannelCode() {
        return channelCode;
    }

    public void setChannelCode(String channelCode) {
        this.channelCode = channelCode;
    }

    @Column(name="program_id")
    public String getProgramId() {
        return programId;
    }

    public void setProgramId(String programId) {
        this.programId = programId;
    }

    @Column(name="program_name")
    public String getProgramName() {
        return programName;
    }

    public void setProgramName(String programName) {
        this.programName = programName;
    }

    @Column(name="category_name")
    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    @Column(name="album_name")
    public String getAlbumName() {
        return albumName;
    }

    public void setAlbumName(String albumName) {
        this.albumName = albumName;
    }

    @Column(name="program_time")
    public int getProgramTime() {
        return programTime;
    }

    public void setProgramTime(int programTime) {
        this.programTime = programTime;
    }

    @Column(name="header_complete_numbers")
    public int getHeaderCompleteNumbers() {
        return headerCompleteNumbers;
    }

    public void setHeaderCompleteNumbers(int headerCompleteNumbers) {
        this.headerCompleteNumbers = headerCompleteNumbers;
    }

    @Column(name="header_incomplete_numbers")
    public int getHeaderIncompleteNumbers() {
        return headerIncompleteNumbers;
    }

    public void setHeaderIncompleteNumbers(int headerIncompleteNumbers) {
        this.headerIncompleteNumbers = headerIncompleteNumbers;
    }

    @Column(name="header_fault_numbers")
    public int getHeaderFaultNumbers() {
        return headerFaultNumbers;
    }

    public void setHeaderFaultNumbers(int headerFaultNumbers) {
        this.headerFaultNumbers = headerFaultNumbers;
    }

    @Column(name="last_complete_numbers")
    public int getLastCompleteNumbers() {
        return lastCompleteNumbers;
    }

    public void setLastCompleteNumbers(int lastCompleteNumbers) {
        this.lastCompleteNumbers = lastCompleteNumbers;
    }

    @Column(name="last_incomplete_numbers")
    public int getLastIncompleteNumbers() {
        return lastIncompleteNumbers;
    }

    public void setLastIncompleteNumbers(int lastIncompleteNumbers) {
        this.lastIncompleteNumbers = lastIncompleteNumbers;
    }

    @Column(name="last_fault_numbers")
    public int getLastFaultNumbers() {
        return lastFaultNumbers;
    }

    public void setLastFaultNumbers(int lastFaultNumbers) {
        this.lastFaultNumbers = lastFaultNumbers;
    }

    @Column(name="ad_complete_numbers")
    public int getAdCompleteNumbers() {
        return adCompleteNumbers;
    }

    public void setAdCompleteNumbers(int adCompleteNumbers) {
        this.adCompleteNumbers = adCompleteNumbers;
    }

    @Column(name="ad_incomplete_numbers")
    public int getAdIncompleteNumbers() {
        return adIncompleteNumbers;
    }

    public void setAdIncompleteNumbers(int adIncompleteNumbers) {
        this.adIncompleteNumbers = adIncompleteNumbers;
    }

    @Column(name="ad_fault_numbers")
    public int getAdFaultNumbers() {
        return adFaultNumbers;
    }

    public void setAdFaultNumbers(int adFaultNumbers) {
        this.adFaultNumbers = adFaultNumbers;
    }

    @Column(name = "user")
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @Column(name = "st_time")
    public Timestamp getStatisticTime() {
        return statisticTime;
    }

    public void setStatisticTime(Timestamp statisticTime) {
        this.statisticTime = statisticTime;
    }
}
